package com.lmx.api.service.impl.inneriml;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.lmx.api.service.UserService;
import com.lmx.commen.model.entity.User;
import org.apache.dubbo.config.annotation.DubboService;

import javax.annotation.Resource;


/**
 * 用户服务
 *
 * @author yupi
 */
@DubboService
public class InnerUserServiceImpl implements com.lmx.commen.service.InnerUserService {
    @Resource
    private UserService userService;

    @Override
    public User getUserByAccessKey(String accessKey) {
        if (accessKey != null) {
            LambdaQueryWrapper<User> queryWrapper = new LambdaQueryWrapper<>();
            queryWrapper.eq(User::getAccessKey, accessKey);
            User accesskeyUser = userService.getOne(queryWrapper);
            return accesskeyUser;
        }

        return null;
    }
}
